package com.cyy.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ArticleReadVerifyType {
    OFF(0, false, "不需要验证"),
    LIKE(1, true, "点赞验证"),
    FOLLOW(2, true, "关注验证");
    private final Integer code;

    private final Boolean isNeedVerify;

    private final String desc;

    public static ArticleReadVerifyType fromInt(Integer code) {
        for (ArticleReadVerifyType value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
